package com.baidu.day07;
//抽象类
    //抽象类用abstract关键字修饰，不能实例化，只能被继承 抽象方法也是abstract修饰
   //抽象方法用abstract关键字修饰，不能有方法体，只能在子类中实现
  //抽象方法只能出现在抽象类中;

public  abstract class Animal {
    public abstract void method();
     private String name;
     private int age;
    public Animal() {
    }
    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;

    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public void eat(){
        System.out.println("动物吃东西");
    }
    public void fly(){}
}
